home *** CD-ROM | disk | FTP | other *** search
/ Programming in Microsoft Windows with C# / Programacion en Microsoft Windows con C#.iso / Codigo / Imágenes y mapas de bits / PartialImage / PartialImage.cs next >
Encoding:
Text File  |  2002-05-06  |  746 b   |  29 lines

  1. //-------------------------------------------
  2. // PartialImage.cs ⌐ 2001 by Charles Petzold
  3. //-------------------------------------------
  4. using System;
  5. using System.Drawing;
  6. using System.Windows.Forms;
  7.  
  8. class PartialImage: PrintableForm
  9. {
  10.      Image image;
  11.  
  12.      public new static void Main()
  13.      {
  14.           Application.Run(new PartialImage());
  15.      }
  16.      public PartialImage()
  17.      {
  18.           Text = "Imagen parcial";
  19.  
  20.           image = Image.FromFile("..\\..\\..\\Apollo11FullColor.jpg");
  21.      }
  22.      protected override void DoPage(Graphics grfx, Color clr, int cx, int cy)
  23.      {
  24.           Rectangle rect = new Rectangle(95, 5, 50, 55);
  25.  
  26.           grfx.DrawImage(image, 0, 0, rect, GraphicsUnit.Pixel);
  27.      }
  28. }
  29.